package com.ciwong.epaper.modules.me.bean;

import com.ciwong.mobilelib.bean.BaseBean;
import com.ciwong.epaper.util.download.DownloadStatus;

/**
 * 作业内容 Created by pla-gysu on 2015/7/29.
 */
public class WorkContents extends BaseBean {


    private static final long serialVersionUID = -9173800156162543689L;
    private long userId;

    private String userName;
    /**
     * 新资源下载地址，旧资源此值为空
     */
    public String resourceUrl;


    /**
     * 资源包ID
     * 也是书本id productId。
     */
    private String packageId = "0";

    /**
     * 资源包目录ID
     */
    private String cId = "0";

    /**
     * 目录模块类型ID
     */
    public int moduleId;
    /**
     * 作业类型：0普通作业，1考试作业(旧)
     */
    public int workType;

    /**
     * 作业模式：0 练习模式，1为机房模式，2考试模式
     */
    private int examMode;
    /**
     * 查看类型：0 提交立马能查看，1截止时间到后查看
     */
    private int seeWorkMode;
    /**
     * 补交类型：0 截止时间到后能补交 1截止时间到后不能补交
     */

    private int submitMode;

    /**
     * 显示分数类型：0 截止时间前显示，1截止时间前不显示
     */
    private int showScoreMode;

    /**
     * 是否自动退回模式，1-需要自动退回   0-不需要自动退回
     */
    private int autoRefuseMode;

    /**
     * 自动退回用户设定的分值百分比数字值，前端传值的区间为整数 1- 99
     */
    private int autoRefusePercent;


    /**
     * 资源版本ID
     */
    private String versionId = "0";

    /**
     * 父级资源版本ID
     */
    public String parentVersionId = "0";

    /**
     * 资源名称
     */
    private String resourceName;

    /**
     * 基础资源类型
     */
    private String resourceType;

    /**
     * 资源作业要求JSON字符串,没有则为空
     */
    public String requirementContent;

    /**
     * 做作业ID
     */
    private String doWorkId;

    /**
     * 作业实际得分
     */
    public String showScore;

    /**
     * 作业用时(秒)
     */
    private int workLong;

    /**
     * 作业提交内容URL
     */
    private String doWorkPackageUrl;

    /**
     * 作业状态(1:已提交 2:退回 4:已批改完成 8:无法识别答题卡 16:等待批改)
     */
    public int workStatus;

    /**
     * 作业已提交次数(用于判断是否做)
     */
    private int submitCount;

    /**
     * 作业已提交次数
     */
    private int feedbackCount;

    /**
     * 退回作业doworkid
     */
    private String feedbackDoWorkId;

    /**
     * 评论内容
     */
    private String commentContent;

    private String comment;
    /**
     * 下载包大小
     */
    public String fileSize;
    /**
     * 总分
     */
    public float workScore;

    /**
     * 是否又被退回：0没有，1有
     */
    public int feedback;

    public int contentId;

    /**
     * 服务是否可用, 0 - 不可用, 1 - 可用
     */
    public int isValid;

    /**
     * 下载进度
     */
    public int downLoadProgress;
    public int groupPosition = -1;
    public int childPosition = -1;
    /**
     * 作业类型：1-书本作业 2-试卷作业
     */
    public int workTag;


    private int classId;

    /**
     * 选中的资源(同步跟读：id字符串；听说模考：下标字符串)
     * 目前只有听说模考有字段内容，比如一份试卷有10题只选中其中几题布置
     */
    private String checkedResource;

    /**
     * 下载状态 {@link DownloadStatus}
     */
    private int downloadStatus;
    /**
     * 作业提交时间
     */
    private long submitDate;
    /**
     * 服务器时间
     */
    private long nowDate;
    /**
     * 未知
     */
    private boolean isCheck;
    /**
     * 错题个数
     */
    private int errorNum;

    /**
     * 错题作业参考分值
     */
    public float errorWorkScore;

    /**
     * 错题作业最后实际得分
     */
    public float errorActualScore;
    /**
     * 订正错题提交时间
     */
    private long errorSubmitDate;

    /**
     * 订正错题学生作业ID
     */
    private String errorWorkId;

    /**
     * 错题本题号(英文,隔开)
     */
    private String errorResource;

    /**
     * "codeId"  999：老师手动退回,  其他：自动退回
     */
    private int codeId;

    private long startTime;

    /**
     * 布置作业总人数
     */
    private int totalNum;
    /**
     * 完成作业总人数
     */
    private int finishCount;

    /**
     * 作业是否是免费书籍作业
     */
    private int isFree;

    public String getShowScore() {
        return showScore;
    }

    public void setShowScore(String showScore) {
        this.showScore = showScore;
    }

    public String getFeedbackDoWorkId() {
        return feedbackDoWorkId;
    }

    public void setFeedbackDoWorkId(String feedbackDoWorkId) {
        this.feedbackDoWorkId = feedbackDoWorkId;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public int getClassId() {
        return classId;
    }

    public void setClassId(int classId) {
        this.classId = classId;
    }

    public long getSubmitDate() {
        return submitDate;
    }

    public void setSubmitDate(long submitDate) {
        this.submitDate = submitDate;
    }


    public String getPackageId() {
        return packageId;
    }

    public void setPackageId(String packageId) {
        this.packageId = packageId;
    }

    public String getcId() {
        return cId;
    }

    public void setcId(String cId) {
        this.cId = cId;
    }

    public int getModuleId() {
        return moduleId;
    }

    public void setModuleId(int moduleId) {
        this.moduleId = moduleId;
    }

    public String getVersionId() {
        return versionId;
    }

    public void setVersionId(String versionId) {
        this.versionId = versionId;
    }

    public String getParentVersionId() {
        return parentVersionId;
    }

    public int getWorkType() {
        return workType;
    }

    public void setWorkType(int workType) {
        this.workType = workType;
    }

    public void setParentVersionId(String parentVersionId) {
        this.parentVersionId = parentVersionId;

    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getResourceType() {
        return resourceType;
    }

    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }

    public String getRequirementContent() {
        return requirementContent;
    }

    public void setRequirementContent(String requirementContent) {
        this.requirementContent = requirementContent;
    }

    public String getDoWorkId() {
        return doWorkId;
    }

    public void setDoWorkId(String doWorkId) {
        this.doWorkId = doWorkId;
    }

    public int getWorkLong() {
        return workLong;
    }

    public void setWorkLong(int workLong) {
        this.workLong = workLong;
    }

    public String getDoWorkPackageUrl() {
        return doWorkPackageUrl;
    }

    public int getFeedback() {
        return feedback;
    }

    public void setFeedback(int feedback) {
        this.feedback = feedback;
    }

    public void setDoWorkPackageUrl(String doWorkPackageUrl) {
        this.doWorkPackageUrl = doWorkPackageUrl;
    }

    public int getWorkStatus() {
        return workStatus;
    }

    public void setWorkStatus(int workStatus) {
        this.workStatus = workStatus;
    }

    public int getSubmitCount() {
        return submitCount;
    }

    public void setSubmitCount(int submitCount) {
        this.submitCount = submitCount;
    }

    public String getCommentContent() {
        return commentContent;
    }

    public String getCheckedResource() {
        return checkedResource;
    }

    public void setCheckedResource(String checkedResource) {
        this.checkedResource = checkedResource;
    }

    public int getFeedbackCount() {
        return feedbackCount;
    }

    public void setFeedbackCount(int feedbackCount) {
        this.feedbackCount = feedbackCount;
    }

    public void setCommentContent(String commentContent) {
        this.commentContent = commentContent;
    }

    public int getDownloadStatus() {
        return downloadStatus;
    }

    public void setDownloadStatus(int downloadStatus) {
        this.downloadStatus = downloadStatus;
    }


    public boolean isCheck() {
        return isCheck;
    }

    public void setIsCheck(boolean isCheck) {
        this.isCheck = isCheck;
    }

//    public void setServiceType(int serviceType) {
//        this.serviceType = serviceType;
//    }
//
//    public int getServiceType() {
//        return serviceType;
//    }


    public int getCodeId() {
        return codeId;
    }

    public void setCodeId(int codeId) {
        this.codeId = codeId;
    }

    public void setContentId(int contentId) {
        this.contentId = contentId;
    }

    public int getContentId() {
        return contentId;
    }

    public void setWorkScore(float workScore) {
        this.workScore = workScore;
    }

    public float getWorkScore() {

        return workScore;

    }

    public long getNowDate() {
        return nowDate;
    }

    public void setNowDate(long nowDate) {
        this.nowDate = nowDate;
    }

    public int getExamMode() {
        return examMode;
    }

    public void setExamMode(int examMode) {
        this.examMode = examMode;
    }

    public int getSeeWorkMode() {
        return seeWorkMode;
    }

    public void setSeeWorkMode(int seeWorkMode) {
        this.seeWorkMode = seeWorkMode;
    }

    public int getSubmitMode() {
        return submitMode;
    }

    public void setSubmitMode(int submitMode) {
        this.submitMode = submitMode;
    }

    public int getErrorNum() {
        return errorNum;
    }

    public void setErrorNum(int errorNum) {
        this.errorNum = errorNum;
    }

    public float getErrorWorkScore() {
        return errorWorkScore;
    }

    public void setErrorWorkScore(float errorWorkScore) {
        this.errorWorkScore = errorWorkScore;
    }

    public float getErrorActualScore() {
        return errorActualScore;
    }

    public void setErrorActualScore(float errorActualScore) {
        this.errorActualScore = errorActualScore;
    }

    public long getErrorSubmitDate() {
        return errorSubmitDate;
    }

    public void setErrorSubmitDate(long errorSubmitDate) {
        this.errorSubmitDate = errorSubmitDate;
    }

    public String getErrorWorkId() {
        return errorWorkId;
    }

    public void setErrorWorkId(String errorWorkId) {
        this.errorWorkId = errorWorkId;
    }

    public String getErrorResource() {
        return errorResource;
    }

    public void setErrorResource(String errorResource) {
        this.errorResource = errorResource;
    }

    public int getShowScoreMode() {
        return showScoreMode;
    }

    public void setShowScoreMode(int showScoreMode) {
        this.showScoreMode = showScoreMode;
    }

    public int getAutoRefuseMode() {
        return autoRefuseMode;
    }

    public void setAutoRefuseMode(int autoRefuseMode) {
        this.autoRefuseMode = autoRefuseMode;
    }

    public int getAutoRefusePercent() {
        return autoRefusePercent;
    }

    public void setAutoRefusePercent(int autoRefusePercent) {
        this.autoRefusePercent = autoRefusePercent;
    }

    public int getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(int totalNum) {
        this.totalNum = totalNum;
    }

    public int getFinishCount() {
        return finishCount;
    }

    public void setFinishCount(int finishCount) {
        this.finishCount = finishCount;
    }

    public int getIsValid() {
        return isValid;
    }

    public void setIsValid(int isValid) {
        this.isValid = isValid;
    }

    public int getIsFree() {
        return isFree;
    }

    public void setIsFree(int isFree) {
        this.isFree = isFree;
    }

    @Override
    public String toString() {
        return "WorkContents{" +
                "userId=" + userId +
                ", userName='" + userName + '\'' +
                ", resourceUrl='" + resourceUrl + '\'' +
                ", packageId='" + packageId + '\'' +
                ", cId='" + cId + '\'' +
                ", moduleId=" + moduleId +
                ", workType=" + workType +
                ", examMode=" + examMode +
                ", seeWorkMode=" + seeWorkMode +
                ", submitMode=" + submitMode +
                ", showScoreMode=" + showScoreMode +
                ", autoRefuseMode=" + autoRefuseMode +
                ", autoRefusePercent=" + autoRefusePercent +
                ", versionId='" + versionId + '\'' +
                ", parentVersionId='" + parentVersionId + '\'' +
                ", resourceName='" + resourceName + '\'' +
                ", resourceType='" + resourceType + '\'' +
                ", requirementContent='" + requirementContent + '\'' +
                ", doWorkId='" + doWorkId + '\'' +
                ", showScore='" + showScore + '\'' +
                ", workLong=" + workLong +
                ", doWorkPackageUrl='" + doWorkPackageUrl + '\'' +
                ", workStatus=" + workStatus +
                ", submitCount=" + submitCount +
                ", feedbackCount=" + feedbackCount +
                ", feedbackDoWorkId='" + feedbackDoWorkId + '\'' +
                ", commentContent='" + commentContent + '\'' +
                ", comment='" + comment + '\'' +
                ", fileSize='" + fileSize + '\'' +
                ", workScore=" + workScore +
                ", feedback=" + feedback +
                ", contentId=" + contentId +
                ", downLoadProgress=" + downLoadProgress +
                ", groupPosition=" + groupPosition +
                ", childPosition=" + childPosition +
                ", workTag=" + workTag +
                ", classId=" + classId +
                ", checkedResource='" + checkedResource + '\'' +
                ", downloadStatus=" + downloadStatus +
                ", submitDate=" + submitDate +
                ", nowDate=" + nowDate +
                ", isCheck=" + isCheck +
                ", errorNum=" + errorNum +
                ", errorWorkScore=" + errorWorkScore +
                ", errorActualScore=" + errorActualScore +
                ", errorSubmitDate=" + errorSubmitDate +
                ", errorWorkId='" + errorWorkId + '\'' +
                ", errorResource='" + errorResource + '\'' +
                ", codeId=" + codeId +
                ", startTime=" + startTime +
                ", totalNum=" + totalNum +
                ", finishCount=" + finishCount +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        WorkContents contents = (WorkContents) o;
        return contents.getPackageId().equals(getPackageId())
                && contents.getcId().equals(getcId())
                && contents.getVersionId().equals(getVersionId())
                && contents.getParentVersionId().equals(getParentVersionId());
    }
}
